<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2022/5/16
  Time: 14:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>相关文档</title>

</head>


<body>
<div>
    <h1 class="text-center">增加文档</h1>

    <table class="table table-bordered">
        <thead>
        <tr>
            <th>标题</th>
            <th>作者</th>
            <th>发布者</th>
            <th>发布日期</th>
            <th>备注</th>

        </tr>
        </thead>
        <tbody>
        <tr>
            <td><input id="tite" type="text"></td>
            <td><input id="author" type="text"></td>
            <td><input id="publisher" type="text"></td>
            <td><input id="gmt_modified" type="date"></td>
            <td><input id="remarks" type="text"></td>


        </tr>
        </tbody>

    </table>

</div>
<div class="text-center">
    <a id="save" class="btn btn-info" href="javascript:" role="button">增加</a>
    <a id="qiuxiao" class="btn btn-info" href="javascript:" role="button">关闭</a></div>
</div>
</body>
<script type="text/javascript">

    $(function () {
        $("#save").click(function () {
            var tite=$("#tite").val()
            var author=$("#author").val()
            var publisher=$("#publisher").val()
            var gmt_modified=$("#gmt_modified").val()
            var remarks=$("#remarks").val()
            var searchMap = {
                "tite" : tite,
                "author": author,
                "publisher" :publisher,
                "gmt_modified":gmt_modified,
                "remarks":remarks
            };
            $.ajax({
                url: '/eme/addsfile',
                type: 'post',
                dataType:'json',
                data: JSON.stringify(searchMap),
                contentType: "application/json",
                success: function () {
                    alert("保存成功")
                    window.location.href="troubleRemoval";

                },
                error: function () {
                    alert("保存失败")
                }
            })
        })
        $("#qiuxiao").click(function () {
            window.location.href="troubleRemoval";
        })
    })
</script>
</html>
